package xuegao.study.mall.admin.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.admin.feign.OmsOrderSettingClient;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.oms.OmsOrderSetting;

@RestController
@RequestMapping("/orderSetting")
public class OmsOrderSettingController {

    @Autowired
    private OmsOrderSettingClient omsOrderSettingClient;

    @ApiOperation("获取指定订单设置")
    @GetMapping(value = "/{id}")
    public CommonResult<OmsOrderSetting> getItem(@PathVariable Long id) {
        return omsOrderSettingClient.getItem(id);
    }

    @ApiOperation("修改指定订单设置")
    @PostMapping(value = "/update/{id}")
    public CommonResult update(@PathVariable Long id, @RequestBody OmsOrderSetting omsOrderSetting) {
        return omsOrderSettingClient.update(id, omsOrderSetting);
    }
}
